﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using TRPOP.Common;
using TRPOP.CRM.Component.Business;
using TRPOP.CRM.Component.Common;
using TRPOP.CRM.Component.Model;

namespace TRPOP.CRM.Web
{
    public partial class WorkComment_save : BaseAdmin
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int intWorkLogID = RequestHelper.RequestInt("id");
            if (intWorkLogID > 0)
            {
                WorkCommentInfo oWorkCommentInfo = new WorkCommentInfo();

                oWorkCommentInfo.dtCreationTime = DateTime.Now;
                oWorkCommentInfo.iEmployeeID = base.GetCurrentEmployeeInfo().iEmployeeID;
                oWorkCommentInfo.iWorkingLogID = intWorkLogID;
                oWorkCommentInfo.nvcWorkCommentContent = txtDescription.Text;

                if (EmployeeManage.SaveWorkComment(oWorkCommentInfo))
                {
                    ExecuteJsWidthEnd("alert('批注成功!');parent.location = '/Company/Company_followingStoryList.aspx';");
                    ParentClose();
                }
                else
                {
                    Alert("批注失败!");
                }
            }
        }
    }
}